class Place < ActiveRecord::Base

  set_table_name 'local'

  belongs_to :organ, :foreign_key => 'orgao'
  belongs_to :localtype, :foreign_key => 'tipolocal'
  
  validates_presence_of :id
  validates_presence_of :nome
  validates_presence_of :orgao
  validates_presence_of :capacidade
  validates_presence_of :tipolocal
  validates_presence_of :disponivel
  validates_uniqueness_of :id
  validates_numericality_of :id

  def to_s
    self.nome
  end

end
